package cn.isjinhao.crws.sql.grammar.update;

import cn.isjinhao.crws.sql.grammar.AbstractParser;
import cn.isjinhao.crws.sql.grammar.CurdStatement;
import cn.isjinhao.crws.sql.lexical.scan.TokenSequence;

/**
 * @Author ISJINHAO
 * @Date 2021/4/5 12:03
 */
public class UpdateParser extends AbstractParser<CurdStatement> {

    protected UpdateParser(TokenSequence tokenSequence) {
        super(tokenSequence);
    }

    @Override
    protected CurdStatement primary() {
        return null;
    }

    /**
     * update           ->  "update" IDENTIFIER "set" (IDENTIFIER = binaryArithmetic) ("," IDENTIFIER = binaryArithmetic)* whereSeg
     * whereSeg         ->  "where" logic
     *
     * logic            ->  comparison (("or" | "and") comparison)*
     * comparison       ->  binaryArithmetic ((">" | "<" | ">=" | "<=" | "!=" | "=" | "like" | "contains") binaryArithmetic)?
     * binaryArithmetic ->  unaryArithmetic (("+" | "-" | "*" | "/") unaryArithmetic)*
     * unaryArithmetic  ->  ("!"|"-") unaryArithmetic | primary
     * primary          ->  "true" | "false" | "null" | NUMBER | STRING | "(" logic ")" | function
     * function         ->  functionName "(" binaryArithmetic? ("," binaryArithmetic)* ")"
     * functionName     ->  "date_to_timestamp" | "date_to_str" | "str_to_date" | "str_to_timestamp" | "timestamp_to_date" | "timestamp_to_str" | "now"
     */
    @Override
    public CurdStatement parse() {
        return null;
    }

}
